import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';

class Welfare extends StatefulWidget {
  const Welfare({Key? key}) : super(key: key);

  @override
  _WelfareState createState() => _WelfareState();
}

class _WelfareState extends State<Welfare> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: RefreshIndicator( // 刷新
        onRefresh: () async {
          await Future.delayed(Duration(seconds: 1));
        },
        child: MasonryGridView.count(
          itemCount: 12,
          crossAxisCount: 2,
          mainAxisSpacing: 8.0,
          crossAxisSpacing: 8.0,
          itemBuilder: (BuildContext context, int index) {
            return Image(
                image: AssetImage('images/fl${index+1}.png')
            );
          }
        ),
      )
    );
  }
}
